package v1
////
import (
	"{{.table.ModuleName}}/internal/model"
	"{{.table.ModuleName}}/internal/model/entity"
	"github.com/gogf/gf/v2/frame/g"
)
////
//{{.table.ClassName}}PageListReq 分页查询{{.table.FunctionName}}Req
type {{.table.ClassName}}PageListReq struct {
	g.Meta `path:"/pageList" tags:"{{.table.ClassName}}" method:"post" summary:"分页查询{{.table.FunctionName}}"`
	model.PageReq
	*entity.{{.table.ClassName}}
}
////
//{{.table.ClassName}}PageListRes 分页查询{{.table.FunctionName}}Res
type {{.table.ClassName}}PageListRes struct {
	Total int                   `json:"total" dc:"行数"`
	Rows  []*entity.{{.table.ClassName}} `json:"rows" dc:"{{.table.FunctionName}}数组"`
}
////
//{{.table.ClassName}}ListReq 列表查询{{.table.FunctionName}}Req
type {{.table.ClassName}}ListReq struct {
	g.Meta `path:"/list" tags:"{{.table.ClassName}}" method:"post" summary:"列表查询{{.table.FunctionName}}"`
	*entity.{{.table.ClassName}}
}
////
//{{.table.ClassName}}ListRes 列表查询Res
type {{.table.ClassName}}ListRes struct {
	Rows  []*entity.{{.table.ClassName}} `json:"rows" dc:"{{.table.FunctionName}}数组"`
}
////
//{{.table.ClassName}}AddReq 添加{{.table.FunctionName}}Req
type {{.table.ClassName}}AddReq struct {
	g.Meta `path:"/" tags:"{{.table.ClassName}}" method:"post" summary:"添加{{.table.FunctionName}}"`
{{range $index, $column := .table.Columns}}
    {{if eq $column.IsInsert "1"}}
    {{$column.GoField}}  {{$column.GoType}} `json:"{{$column.JavaField}}" {{if eq $column.IsRequired "1"}}v:"required#{{ $column.ColumnComment }}不能为空"{{end}}  dc:"{{ $column.ColumnComment }}"`
    {{end}}
{{end}}
}
////
//{{.table.ClassName}}AddRes 添加{{.table.FunctionName}}Req
type {{.table.ClassName}}AddRes struct {
	Msg  string  `json:"msg" dc:"添加提示"`
}
////
//{{.table.ClassName}}EditReq 编辑{{.table.FunctionName}}Req
type {{.table.ClassName}}EditReq struct {
	g.Meta `path:"/" tags:"{{.table.ClassName}}" method:"put" summary:"编辑{{.table.FunctionName}}"`
{{range $index, $column := .table.Columns}}
    {{if or (eq $column.IsEdit "1") (eq $column.IsPk "1") }}
    {{$column.GoField}}  {{$column.GoType}} `json:"{{$column.JavaField}}" {{if eq $column.IsRequired "1"}}v:"required#{{ $column.ColumnComment }}不能为空"{{end}}  dc:"{{ $column.ColumnComment }}"`
    {{end}}
{{end}}
}
////
//{{.table.ClassName}}EditRes 编辑{{.table.FunctionName}}Res
type {{.table.ClassName}}EditRes struct {
	Msg  string  `json:"msg" dc:"编辑提示"`
}
////
//{{.table.ClassName}}DelReq 删除{{.table.FunctionName}}Req
type {{.table.ClassName}}DelReq struct {
	g.Meta `path:"/" tags:"{{.table.ClassName}}" method:"delete" summary:"删除{{.table.FunctionName}}"`
	Ids    []int `json:"ids" v:"required#请选择需要删除的数据" dc:"id集合"`
}
////
//{{.table.ClassName}}DelRes 删除{{.table.FunctionName}}Res
type {{.table.ClassName}}DelRes struct {
	Msg  string  `json:"msg" dc:"删除提示"`
}